<?php if(!empty($output['list'])){?>
<?php foreach($output['list'] as $val){?>
<div class="orderItem">
  <div class="title" style="background-image: url(<?php echo $val['user_avatar'];?>)">
	<div class="nickname"> <a href="<?php echo BASE_SITE_URL;?>/index.php?act=my&op=home&uid=<?php echo $val['user_id'];?>&user_id=<?php  echo $val['seller_id'];?>"><?php echo $val['nickname'];?></a> </div>       
	<div class="status green">
			<?php 
				if($val['order_state']=='0'){ 
					if($val['is_fail'] == '1'){
						echo '交易失败';
					}else{
						echo '待付款1';
					}					
				}elseif($val['order_state']=='1'){
					echo '已支付未发货';
				}elseif($val['order_state']=='2'){
					if($val['is_tuihuo']==1){
						if($val['is_fail']==1){
							echo '交易失败';
						}else{
							if($val['is_accept']==1){
								echo '同意退货';
							}elseif($val['is_accept']==2){
								echo '待收货';
							}else{
								echo '申请退货';
							}							
						}
						
					}else{
						if($val['currentexchange']=='1'&&$output['order']['is_fail']==1){
							echo '交易失败';							
						}else{
							echo '待收货';
						}
						
					}
					
				}else{ 
					echo '交易完成';
				}?>     
	</div>
  </div>

  <div class="info"> 
	<a href="<?php echo BASE_SITE_URL;?>/index.php?act=order&op=ordersellerdetail&auction_id=<?php echo $val['auction_id'];?>">
	<?php if($val['order_state']=='0'){?>
		<?php if($val['is_fail']==1){?>
		<div class="content">
		  <div class="goodsImg" style="background-image:url(<?php echo UPLOAD_SITE_URL.'/shop/auction/'.$val['auction_add_date'].'/'.$val['auction_img1'];?>);"> </div>
		  <div class="desc"><?php echo bearshop_auction_description_substr($val['auction_description']);?></div>
		  <ul>
			<li><span>交易失败</span></li>            
			<li><span>截至时间：</span><?php echo date("Y-m-d H:i:s",$val['add_time']);?></li>
		  </ul>
		</div>
		<?php }else{?>
		<div class="content">
		  <div class="goodsImg" style="background-image:url(<?php echo UPLOAD_SITE_URL.'/shop/auction/'.$val['auction_add_date'].'/'.$val['auction_img1'];?>);"> </div>
		  <div class="desc"><?php echo bearshop_auction_description_substr($val['auction_description']);?></div>
		  <ul>
			<li><span>成交金额：</span>￥<?php echo $val['price'];?>元</li>            
			<li><span>成交时间：</span><?php echo date("Y-m-d H:i:s",$val['add_time']);?></li>
		  </ul>
		</div>
		<div class="pay">待付：<span>￥<?php echo $val['price'];?>元</span></div>  
		<?php }?>        
	<?php }elseif($val['order_state']=='1'){?>
	<?php if($val['is_fail']==1){?>
		<div class="content">
		  <div class="goodsImg" style="background-image:url(<?php echo UPLOAD_SITE_URL.'/shop/auction/'.$val['auction_add_date'].'/'.$val['auction_img1'];?>);"> </div>
		  <div class="desc"><?php echo bearshop_auction_description_substr($val['auction_description']);?></div>
		  <ul>
			<li><span>交易失败：</span>卖家未发货</li>            
			<li><span>交易时间：</span><?php echo date("Y-m-d H:i:s",$val['payment_time']);?></li>
		  </ul>
		</div>
	<?php }else{?>
	<div class="content">
	  <div class="goodsImg" style="background-image:url(<?php echo UPLOAD_SITE_URL.'/shop/auction/'.$val['auction_add_date'].'/'.$val['auction_img1'];?>);"> </div>
	  <div class="desc"><?php echo bearshop_auction_description_substr($val['auction_description']);?></div>
	  <ul>
		<li><span>成交金额：</span>￥<?php echo $val['price'];?>元</li>            
		<li><span>发货期限：</span><?php echo date("Y-m-d H:i:s",($val['end_time']+3*24*3600));?></li>
	  </ul>
	</div>
	<div class="pay">已付：<span>￥<?php echo $val['price'];?>元</span></div>
	<?php }?>

	<?php }elseif($val['order_state']=='2'){?>
	<div class="content">
	  <div class="goodsImg" style="background-image:url(<?php echo UPLOAD_SITE_URL.'/shop/auction/'.$val['auction_add_date'].'/'.$val['auction_img1'];?>);"> </div>
	  <div class="desc"><?php echo bearshop_auction_description_substr($val['auction_description']);?></div>
	  <ul>
		<li><span>成交金额：</span>￥<?php echo $val['price'];?>元</li>            
		<li><span>成交时间：</span><?php echo date("Y-m-d H:i:s",$val['add_time']);?></li>
	  </ul>
	</div>
	<?php if($val['currentexchange']!='1'){?>
	<div class="pay">已付：<span>￥<?php echo $val['price'];?>元</span></div>
	<?php }?>
	<?php }elseif($val['order_state']=='3'){?>
	<div class="content">
	  <div class="goodsImg" style="background-image:url(<?php echo UPLOAD_SITE_URL.'/shop/auction/'.$val['auction_add_date'].'/'.$val['auction_img1'];?>);"> </div>
	  <div class="desc"><?php echo bearshop_auction_description_substr($val['auction_description']);?></div>
	  <ul>
		<li><span>成交金额：</span>￥<?php echo $val['price'];?>元</li>            
		<li><span>收货时间：</span><?php echo date("Y-m-d H:i:s",$val['shouhuo_time']);?></li>
	  </ul>
	</div>
	<?php }?>
	</a> 
 </div>

  <?php if($val['order_state']=='1' && $val['is_fail']!='1'){?>      	
  <div class="tools">
		  <button class="mysendout" order_id="<?php echo $val['id'];?>">立即发货</button>
  </div>
  <?php }elseif($val['order_state']=='2'){?>
	  <?php if($val['is_accept']==2&&$val['is_fail']!=1){?>
	  <div class="tools">
			  <button class="accept" auction_id="<?php echo $val['auction_id'];?>">同意</button>
	  </div>
	  <?php }?>
	  <?php if(empty($val['is_accept']) && $val['is_tuihuo']==1){?>
	  <div class="tools">				      		  
			  <button class="refuse" order_id="<?php echo $val['id'];?>">拒绝</button>
			  <button class="accept" auction_id="<?php echo $val['auction_id'];?>">同意</button>
	  </div>
	  <?php }?>
	  
	  <?php if(($val['is_accept']==1)&&(!empty($val['tuihuo_express']))&&($val['is_fail']!='1')){?>
	  <div class="tools">
			  <button class="confirmtuikuan" order_id="<?php echo $val['id'];?>">确认退款</button>
	  </div>
	  <?php }?>
  <?php }elseif($val['order_state']=='0' && $val['is_fail']!='1'){?>
  <div class="tools">
		  <button class="currentexchange" order_id="<?php echo $val['id'];?>">当面交易</button>
  </div>
  <?php }?>
	
</div>
<?php }?>
<?php }?>